package com.wyd.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.jws.WebParam;

@Controller
public class methodcontroller {

    @RequestMapping(value = "/dopost",method = {RequestMethod.POST})
    public String postmethod(Model model){
        model.addAttribute("msg","post");
        return "test1";
    }



    @GetMapping("/dogetmapp")
    public String dogetmapp(Model model){
        model.addAttribute("msg","getmapping");
        return "test1";
    }

    @PostMapping("/dopostmapp")
    public String dopostmapp(Model model){
        model.addAttribute("msg","postmapping");
        return "test1";
    }

    @RequestMapping(value = "/doget",method = {RequestMethod.GET})
    public String getmethod(Model model){
        model.addAttribute("msg","get");
        return "test1";
    }
}
